<!DOCTYPE html>
<!-- saved from url=(0040)https://sh.sofang.com/userRegister.html? -->
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
	<title>搜房网普通用户注册</title>
<link rel="stylesheet" type="text/css" href="/搜房网普通用户注册_files/personalLogin.css">
<link rel="stylesheet" type="text/css" href="/搜房网普通用户注册_files/color.css">
<link rel="stylesheet" type="text/css" href="/搜房网普通用户注册_files/common.css">
<link rel="icon" href="http://www.sofang.com/favicon.ico" mce_href="http://www.sofang.com/favicon.ico" type="image/x-icon">
<script src="/搜房网普通用户注册_files/jquery1.11.3.min.js.下载"></script>
</head>
<body>


<header class="header1">
 <div class="head">
  <div class="logo"><a href="https://sh.sofang.com/"><img src="/搜房网普通用户注册_files/broker-Logo.png"></a></div>
  <span class="dotted"></span>
  <h2>普通用户注册</h2>
 </div>
</header>
<div class="cont_bg cont_bg_reg">
	<div class="content content1">
		<div class="register" id="register">
		    <div class="register_r">
		        <h2>用户注册<!--<a class="color_blue modaltrigger" href="#login">立即登录</a>--></h2>
		        <form id="loginform1" name="loginform1" method="post" action="https://sh.sofang.com/userRegister.html?#">
		            <ul class="login_msg">
		                <!--<li>
		                    <label>用户名</label>
		                    <input type="text" name="rname" id="rname" class="txt" onblur="checkname()" placeholder="输入6-21位，字母、数字、下划线的组合">
		                    <i class="an" id="anrname"></i>
		                    <span class="ti" id="error_rname"></span>
		                </li>-->
		                <li>
		                    <label>手机号</label>
		                    <input type="text" name="rmobile" id="rmobile" class="txt" placeholder="请输入手机号">
		                    <i class="an ie_web" id="anmobile"></i>
		                     <span class="ti" id="error_rmobile"></span>
		                </li>
		                <li style="display: none;">
		                    <label>&nbsp;</label>
		                    <input type="text" class="txt width" id="code_val" value="" autocomplete="off">
		                    <img src="/搜房网普通用户注册_files/vercode" alt="验证码" id="ver_code" style="height:32px;margin:5px 0 0 28px;">
		                    <span class="ti" id="error_code"></span>
		                </li>
		                <li>
		                    <label>验证码</label>
		                    <input type="text" name="ryzm" id="ryzm" class="txt width" placeholder="请输入验证码">
		                    <input type="button" id="btn" class="btn1 back_color" value="发送验证码" onclick="getCode()">
		                    <i class="an ie_web" id="anryzm"></i>
		                    <span class="ti" id="error_ryzm"></span>
		                </li>
		                <li>
		                    <label>密码</label>
		                    <input type="password" name="rpwd" id="rpwd" class="txt" maxlength="16" placeholder="密码限制在6-16位">
		                    <i class="an ie_web" id="idpwd"></i>
		                    <span class="ti" id="error_rpwd"></span>
		                </li>
		                <li>
		                    <label>确认密码</label>
		                    <input type="password" name="rpwds" id="rpwds" maxlength="16" class="txt" placeholder="请确认密码">
		                    <i class="an ie_web" id="isrpwd"></i>
		                    <span class="ti" id="error_rpwds"></span>
		                </li>
						<li>
							<label>用户类型</label>
							<input type="radio" name="gender" value="1" checked>普通用户注册
							<input type="radio" name="gender" value="2">经纪人注册
							<span class="ti" id="error_rname"></span>
						</li>
		            </ul>
		            <p class="zhao">
		                <input type="checkbox" id="checkbox1" checked="checked" style="margin-top: 2px;">&nbsp;&nbsp;<span>我已阅读<a href="https://sh.sofang.com/about/registAgreement.html">《搜房网服务协议》</a></span>
		                <span id="error_checkbox" class="ti"></span>
		            </p>
		            <input type="button" class="btn hidemodal back_color" onclick="addUser()" value="立即注册">
		        </form>
		    </div>
		   <a class="returnPhone">返回</a>
		</div>
		<div class="shadow"></div>
	</div>
</div>
<footer class="footer" style="position: absolute; left: 0px; bottom: 0px;">
	<div class="bottom">
		<p>
			<a href="https://sh.sofang.com/about/aboutus.html">关于我们</a>
			<span class="dotted"></span>
			<a href="https://sh.sofang.com/about/contactusNew.html">联系我们</a>
			<span class="dotted"></span>
			<a href="https://sh.sofang.com/about/disclaimer.html">免责声明</a>
			<span class="dotted"></span>
			<a href="https://sh.sofang.com/about/recruit.html">招聘信息</a>
			<span class="dotted"></span>
			<a href="https://sh.sofang.com/about/secret.html">隐私协议</a>
			<span class="dotted"></span>
			<a href="https://sh.sofang.com/questionHelp/usehelp.html">使用帮助</a>
			<span class="dotted"></span>
			<a href="https://sh.sofang.com/ad/cooperation">加盟合作</a>
		</p>
		<p class="p2">
			<span>Copyright&nbsp;©&nbsp;2022</span>
			<span>Sofang.com,&nbsp;All&nbsp;Rights&nbsp;Reserved</span>
			<span> 北京道杰士投资咨询服务有限责任公司 </span>
			<span>版权所有</span>
			<span><a href="http://www.miibeian.gov.cn/" target="_blank">京ICP证040491号</a></span>
		</p>
	</div>
</footer>

<div class="float" style="display: block;">亲，您的浏览器版本过低，为了更好地浏览网页，搜房网建议您更换浏览器：<a href="http://www.chromeliulanqi.com/" target="_blank"><img src="/搜房网普通用户注册_files/google.png" width="22" height="20" alt="">谷歌浏览器</a>&nbsp;或&nbsp;<a href="https://developer.apple.com/safari/" target="_blank"><img src="/搜房网普通用户注册_files/Safari.png" width="20" height="22" alt="">苹果浏览器</a></div>
<script type="text/javascript">
window.onload = function () {
	if (!window.applicationCache) {
	   $(".float").show();
	   $(".an").show();
	   $(".an").addClass("ie_web");
	}
};
</script>
<script src="/搜房网普通用户注册_files/login.js.下载"></script>
<script src="/搜房网普通用户注册_files/telephoneLogin.js.下载"></script>
<script type="text/javascript">
$(document).ready(function(e) {
	$("#login h2 a").click(function(){
	   $("#login h2 a").removeClass("click");
	   $(this).addClass("click");
	   if($(this).text()=="账号密码登录")	{
		  $(".userLogin").show();
		  $(".userLogin1").hide();
	   }else{
		  $(".userLogin1").show();
		  $(".userLogin").hide();
	   }
	});
});

  //尾部置底
	var oH=document.documentElement.clientHeight;
	var header=$('.header').outerHeight();
	var cont=$('.cont_bg').outerHeight();
	var footer=$('.footer').outerHeight();
	var allH=header+cont+footer;
	if(allH<oH){
		$('.footer').css({position:'absolute',left:0,bottom:0});
	}else{
		$('.footer').css('position','static');
	}
	window.onresize=function(){
		if(allH<document.documentElement.clientHeight){
			$('.footer').css({position:'absolute',left:0,bottom:0});
		}else{
			$('.footer').css('position','static');
		}
	}
    </script>

<script>
	// 根据手机号获取验证码
	function getCode() {
		let phone = $("#rmobile").val();

		if (phone == null || phone === '') {
			alert("手机号不能为空");
		}

		alert("您的手机号为：" + phone);

		$.ajax({
			url:'/registrationClient/getCode/' + phone,
			type:'post',
			success:function(res) {
				console.log(res)
				if ( res != null) {
					alert("短信发送成功，请稍等!");
				}
				else {
					alert("登录失败，检查账号密码!");
				}
			}
		})
	}

	// 客户端注册用户
	function addUser(){
		let phone = $("#rmobile").val();
		let code = $("#ryzm").val();
		let password = $("#rpwd").val();
		let passwords = $("#rpwds").val();
		let type = $(":radio:checked").val();

		if ( phone === '') {
			alert("手机号不能为空！");
			return;
		}

		if ( code === '') {
			alert("验证码不能为空！");
			return;
		}

		if ( password === '') {
			alert("登录密码不能为空！");
			return;
		}

		if ( passwords === '') {
			alert("确认密码不能为空！");
			return;
		}
		if (password !== passwords) {
			alert("用户登录密码不一致！");
		}
		else {
			var userRequest = {
				phone: phone,
				code: code,
				password: password,
				passwords: passwords,
				type: type
			}
			userRequest = JSON.stringify(userRequest)
			console.log(userRequest)
			$.ajax({
				url:"/registrationClient/addUser",
				type:'post',
				dataType: "json",
				data: userRequest,
				contentType: 'application/json;charset=utf-8',
				success:function(res) {
					console.log(res)
					if ( res === null) {
						alert("验证码错误！")
					}
					else {
						alert("注册成功，即将跳转登录页面!");
						location.href="/loginClient/login.html";
					}
				}
			})
		}
	}
</script>

</body></html>
